import { ref, computed } from 'vue'
import { defineStore } from 'pinia'

export const searchInfo = defineStore('searchstore',()=>{
    const searchWord = ref("");
    function setsearchWord(word:string){
        searchWord.value = word;
    }
    const labelList = ref([]);
    function setlabelList(labels:[]){
        labelList.value = [];
    }

    return {
        searchWord,
        setsearchWord,
        labelList,
        setlabelList
    }
},

    {
        persist:{
            storage:sessionStorage,
            key:'searchInfo',
            paths:['searchWord','labelList']
        }
    }

)